<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>FUI</title>

    <link rel="stylesheet" type="text/css" href="../theme/default/fui.all.css">

    <script src="../dev-lib/jhtmls.min.js"></script>
    <script src="../dev-lib/jquery-1.11.1.js"></script>
    <script src="../dev-lib/dev-define.js"></script>
    <script>
        inc.config({
            base: '../src'
        });
    </script>
    <script src="../dev-lib/exports.js"></script>
    <script src="../dev-lib/dev-start.js"></script>
    <script>
        window.onload = function () {

            var dialog = new FUI.Dialog( {
                width: 600,
                height: 400,
                caption: '我是一个快乐的Dialog'
            } );

            dialog.positionTo( document.body );

            document.getElementById( "openBtn" ).onclick = function () {

                dialog.open();

            };

            dialog.on( "cancel", function ( e ) {

                console.log(e.type);

            } );

            dialog.on( "ok" , function ( e ) {

                console.log(e.type);

                return false;

            } );

            dialog.on( "beforeclose" , function ( e, state ) {

                state.cancel = true;
                console.log(e.type)

            } );

            dialog.on( "afterclose" , function ( e ) {

                console.log(e.type)

            } );

            dialog.on( "close" , function ( e ) {

                console.log(e.type)

            } );

        };

    </script>
</head>
<body>
    <h1>Dialog 示例</h1>
    <button id="openBtn">打开Dialog</button>
</body>
</html>